<script>
	import Vue from 'vue'
	export default {
		onLaunch: function() {
			uni.getSystemInfo({
				success: function(e) {
					Vue.prototype.screenHeight = e.screenHeight;
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN || MP-QQ
					Vue.prototype.StatusBar = e.statusBarHeight;
					console.log(e.statusBarHeight)
					let capsule = wx.getMenuButtonBoundingClientRect();
					if (capsule) {
						console.log(capsule.top)
						Vue.prototype.Custom = capsule
						Vue.prototype.CustomNavBar = ((capsule.top - e.statusBarHeight) * 2) + capsule.height
						Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					}
					// #endif		
	

					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			})
		},
		onShow: function(option) {
			//获取地址栏上的accesstoken
			if(option.query.accesstoken){
				this.$request.postJson('/unia/admin/login/smk',{"accesstoken":option.query.accesstoken}).then(res=>{
					consolle.log(res)
					uni.setStorageSync('token', res.data.token);
				})
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import "components/colorui/main.css";
	@import "components/colorui/icon.css";
	@import "components/iconfont/iconfont.css";
	@import "assets/css/main.scss";
</style>
